﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace JTicket.UI.Extention.IHandler
{
    public class RoleTypeHandle:IHttpHandler
    { 

        #region IHttpHandler 成员

        public bool IsReusable
        {
            get { return false; }
        }

        public void ProcessRequest(HttpContext context)
        {

            HttpRequest request = context.Request;
            HttpResponse response = context.Response;
            BLL.D_OperInfo bllOper = new BLL.D_OperInfo();
            string leve = bllOper.Oper().CurLevel.Value.ToString();

            int flag = 0;
            try
            {
                List<Model.C_CodeNote> list =
                    BLL.C_CodeNote.GetListGroupRolseByLeve(leve);
                response.Write("[");
                flag = list.Count;
                if (flag > 0)
                {
                    foreach (var x in list)
                    {
                        response.Write(JsonHelper.ObjectToJson(x));
                        if (--flag > 0)
                        {
                            response.Write(",");
                        }
                    }
                }
                response.Write("]");
                return;
            }
            catch
            {
                response.Write("-1");
            }
        }

        #endregion
    }
}
